package org.demo.pattern.factory;
/**
 * 工厂模式
 * 将创建对象的工作提取出来统一管理
 * @author  
 * @date    2011-5-20
 * @file    org.demo.pattern.factory.FactoryTest.java
 */
public class FactoryTest {

	public static void main(String[] args) {
		
		Apple a1 = Factory.getInstance("apple", Apple.class);
		Apple a2 = Factory.getInstance("apple", Apple.class);
		Pear p = Factory.getInstance("pear", Pear.class);
		
		System.out.println(a1);
		System.out.println(a2);
		System.out.println(p);
	}
}
